QT += core gui
QT += charts
CONFIG += console

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++17

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    find_val.cpp \
    get_default_attr.cpp \
    get_output_filename.cpp \
    handle_line.cpp \
    main.cpp \
    parse_config.cpp \
    select_line.cpp \
    sort_csv_by_time.cpp \
    split_by_char.cpp \
    widget.cpp

HEADERS += \
    find_val.h \
    get_default_attr.h \
    get_output_filename.h \
    global_var.h \
    handle_line.h \
    parse_config.h \
    select_line.h \
    sort_csv_by_time.h \
    split_by_char.h \
    widget.h

FORMS += \
    widget.ui

TRANSLATIONS += \
    curve_zh_CN.ts
CONFIG += lrelease
CONFIG += embed_translations

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

# 定义源和目标路径
CONFIG_FILE_SRC = $$PWD/config_file
DEST_DIR = $$OUT_PWD

# 区分不同操作系统并设置相应的复制命令
win32 {
    # Windows-specific commands
    QMAKE_POST_LINK += "xcopy /s /e /y /i \"$$CONFIG_FILE_SRC\" \"$$DEST_DIR/release/config_file\" || exit 0"
} else:macx {
    # macOS-specific commands
    QMAKE_POST_LINK += "cp -R $$CONFIG_FILE_SRC $$DEST_DIR/"
} else:unix {
    # Linux-specific commands (also works for other Unix-like systems)
    QMAKE_POST_LINK += "cp -r $$CONFIG_FILE_SRC $$DEST_DIR/"
}
